import {
  createRouter,
  createWebHashHistory,
  createWebHistory,
  RouteRecordRaw,
} from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/index",
    component: () => import("../pages/index.vue"),
    children: [
      {
        path: "/foundMusic",
        component: () => import("../views/foundMusic/foundMusic.vue"),
        children: [
          {
            path: "/",
            redirect: "recommend",
          },
          {
            path: "/recommend",
            component: () => import("../views/foundMusic/recommend/index.vue"),
          },
          {
            path: "/recommendedSongList",
            component: () =>
              import("../views/foundMusic/recommendedSongList/index.vue"),
          },
        ],
      },
      {
        path: "/searchDetail",
        component: () => import("../views/searchDetail/searchDetail.vue"),
      },
      {
        path: "/videoPlay",
        component: () => import("../views/videoPlay/videoPlay.vue"),
      },
    ],
  },
  {
    path: "/login",
    component: () => import("../pages/login.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
